package com.example.m2;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
//@RabbitListener(queues = "helloworld") //rabbit监听
public class Consumer {

    @RabbitListener(queues = "task_queue") //rabbit监听
    public void receive1(String s) {
        System.out.println("消费者1收到: "+s);
    }

    @RabbitListener(queues = "task_queue") //rabbit监听
    public void receive2(String s) {
        System.out.println("消费者2收到: "+s);
    }


}
